package com.easy.common.enumbean;

import com.baomidou.mybatisplus.annotation.EnumValue;
import com.fasterxml.jackson.annotation.JsonCreator;
import com.fasterxml.jackson.annotation.JsonValue;

import java.io.Serializable;

public enum RoleStatus   implements Serializable {
    //'启用','停用'
    NORMAL("启用"),DISABLE("停用");

    @JsonCreator

    public RoleStatus convert(String val) {
        switch (val) {
            case "启用":
                return NORMAL;
            case "停用":
                return DISABLE;
            default:
                throw new RuntimeException("没有对应的枚举实例");
        }
    }
    @EnumValue
    @JsonValue
    private String value;
    private RoleStatus(String value){
        this.value=value;

    }

    public String valueOf(){
        return this.value;
    }

    public String toString(){
        return this.value;
    }
}
